package com.kehutong.payfees.admin;

import com.kehutong.common.util.Token;
import com.kehutong.payfees.service.ChargeChooseServiceImpl;
import com.kehutong.payfees.service.ChargeMonthReadServiceImpl;
import com.kehutong.payfees.util.BasicClient;
import org.coraframework.authz.HasPermission;
import org.coraframework.inject.Inject;
import org.coraframework.json.JSONObject;
import org.coraframework.mvc.MvcAction;
import org.coraframework.mvc.http.ReqMapping;
import org.coraframework.orm.jdbc.JdbcSession;

/**
 * 月度抄表
 */
@MvcAction
@ReqMapping("/admin/charge/month/read")
public class ChargeMonthReadAction {

    @Inject
    private JdbcSession jdbcSession;
    @Inject
    private ChargeMonthReadServiceImpl chargeMonthReadService;
    @Inject
    private ChargeChooseServiceImpl chargeChooseService;
    @Inject
    private BasicClient basicClient;


    @HasPermission("charge:month:view")
    @ReqMapping("/page")
    public Object page(Token token, JSONObject jsonObject) throws Exception {
       return chargeMonthReadService.page(token, jsonObject);
    }

    /**
     * 按页面条件批量导出
     */
    @HasPermission("charge:month:edit")
    @ReqMapping("/export")
    public Object export(Token token, JSONObject jsonObject) throws Exception {
        return chargeMonthReadService.export(token, jsonObject);
    }

    @HasPermission("charge:month:view")
    @ReqMapping("/download")
    public Object download(Token token, JSONObject jsonObject) throws Exception {
        return chargeMonthReadService.download(token, jsonObject);
    }

    @HasPermission("charge:month:edit")
    @ReqMapping("/readFile")
    public Object readFile(Token token, JSONObject jsonObject) throws Exception {
        return chargeMonthReadService.readFile(token, jsonObject);
    }

    @HasPermission("charge:month:edit")
    @ReqMapping("/update")
    public Object update(Token token, JSONObject jsonObject) throws Exception {
        return chargeMonthReadService.update(token, jsonObject);
    }
}
